
import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';
// import 'package:provide/provide.dart';
// import '../../provide/details_info.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';

//import './details_web.dart';

class MyTabs extends StatefulWidget {
  MyTabs({Key key}) : super(key: key);

  _MyTabsState createState() => _MyTabsState();
}
//  const TabBar({
//     Key key,
//     @required this.tabs,//显示的标签内容，一般使用Tab对象,也可以是其他的Widget
//     this.controller,//TabController对象
//     this.isScrollable = false,//是否可滚动
//     this.indicatorColor,//指示器颜色
//     this.indicatorWeight = 2.0,//指示器高度
//     this.indicatorPadding = EdgeInsets.zero,//底部指示器的Padding
//     this.indicator,//指示器decoration，例如边框等
//     this.indicatorSize,//指示器大小计算方式，TabBarIndicatorSize.label跟文字等宽,TabBarIndicatorSize.tab跟每个tab等宽
//     this.labelColor,//选中label颜色
//     this.labelStyle,//选中label的Style
//     this.labelPadding,//每个label的padding值
//     this.unselectedLabelColor,//未选中label颜色
//     this.unselectedLabelStyle,//未选中label的Style
// })
class _MyTabsState extends State<MyTabs> with SingleTickerProviderStateMixin {

  TabController  controller;
  var tabs = <Tab>[];

  @override
  void initState() {
    super.initState();
      tabs = <Tab>[
        Tab(text: "详情"),
        Tab(text: "评论"),
      ];
      controller = TabController(initialIndex: 0, length: tabs.length, vsync: this);
  }

  @override
  Widget build(BuildContext context) {
    return Container(
       width: ScreenUtil().setWidth(750.0),
       color: Colors.white,
       margin: EdgeInsets.only(top:15.0),
       child: Column(
         children: <Widget>[
           TabBar(
              controller: controller,//可以和TabBarView使用同一个TabController
              tabs: tabs,
              indicatorColor: Colors.pink,
              indicatorWeight: 2,
              indicatorSize:TabBarIndicatorSize.tab,
              labelColor: Colors.pink,
              labelStyle: TextStyle(
                fontSize: 18.0,
                color: Colors.black12
              ),
              unselectedLabelColor: Colors.black,
              unselectedLabelStyle: TextStyle(
                fontSize: 16.0,
              ),
            ),
            // Container(
            //   height:ScreenUtil().setHeight(4000.0),
            //   child: TabBarView(
            //     controller: controller,
            //     children: <Widget>[
            //       DetailsWeb(),
            //       Container(
            //         child: Text('评论'),
            //       )
            //     ],
            //   )
            // )
         ],
       ),
    );
  }
}
